"""
语法：
for 临时变量 in 容器:
    循环内部执行的代码
说明：
1. 遍历: 从容器中将数据一个一个的取出的操作
2. 临时变量: 自定义的变量名, 用于取值
3. 容器: 字符串/列表/元组/字典数据
4. for 循环与 while 循环不同, 一般由容器内数据的个数决定循环次数
5. 遍历字典，默认只遍历字典的键

需求：分别遍历如下容器，并打印遍历后的内容
str_data = "hello python"
list_data = ["python", "java"]
tuple_data = ("admin", 123456, 8888)
dict_data = {"name": "tom", "age": 18, "gender": "男"}
"""
str_data = "hello python"
for val in str_data:
    print(val)

print('=' * 50)
list_data = ["python", "java"]
for val in list_data:
    print(val)

print('=' * 50)
tuple_data = ("admin", 123456, 8888)
for val in tuple_data:
    print(val)

dict_data = {"name": "tom", "age": 18, "gender": "男"}
print('=' * 50)
for key in dict_data:
    print(key, type(key))
    print(key, dict_data[key])
    print(key, dict_data.get(key))